package com.antaohua.tools.framework.base.interfase;

import java.util.List;
import java.util.Map;

import com.antaohua.tools.framework.base.exception.DeleteEntityException;
import com.antaohua.tools.framework.base.exception.InsertEntityException;
import com.antaohua.tools.framework.base.exception.QureyEntityException;
import com.antaohua.tools.framework.base.exception.UpdateEntityException;
import com.antaohua.tools.framework.base.model.UUIDIdentityModel;
import com.antaohua.tools.framework.base.utils.PageUtil;

public interface BaseServiceInterface <E extends UUIDIdentityModel>{

	public E save(E entity) throws InsertEntityException;
	
	public List<E> save(List<E> entitys) throws InsertEntityException;
	
	public E update(E entity) throws UpdateEntityException;
	
	public List<E> update(List<E> entitys)throws UpdateEntityException;
	
	public void delete(E entity) throws DeleteEntityException;

	public Integer deleteById(String id) throws DeleteEntityException;

	public Integer deleteByIds(List<String> ids) throws DeleteEntityException;
	
	public Integer deleteByProperty(Map<String, Object> propertys) throws DeleteEntityException;
	
	public Integer deleteByProperty(String propertyName,Object propertyValue) throws DeleteEntityException;
	
	public E findById(String id) throws QureyEntityException;
	
	public List<E> findByIds(List<String> ids) throws QureyEntityException ;
	
	public PageUtil<E> findAll(PageUtil<E> page) throws QureyEntityException ;

	public List<E> findAll() throws QureyEntityException;

	public List<E> findByProperty(String propertyName, Object value) throws QureyEntityException;

	public List<E> findByProperty(Map<String, Object> propertys) throws QureyEntityException;
	
	public Long countByProperty(String propertyName, Object value) throws QureyEntityException;
	
	public Long countByProperty(Map<String, Object> propertys) throws QureyEntityException;

	public Long countAll()  throws QureyEntityException;
	
	public Boolean isExistence(String propertyName, Object value)  throws QureyEntityException;

}
